<?php

class blogForms extends form {

	public static function add($errors)
	{
		$show = self::dispErrors($errors);
		$show .= '
			<form name="addBlogEntry" action="" method="post">
				<fieldset>
					<legend>Add New Blog Entry</legend>
					<ul class="form">
						<li>
							<label for="title"> Title: </label>
						</li>
						<li>
							<input type="text" name="title" value="' . self::postValue('title') .'" />
						</li>
						<li>
							<label for="url"> URL: </label>
						</li>
						<li>
							<input type="text" name="url" value="' . self::postValue('url') .'" />
						</li>
						<li>
							<label for="content"> Content: </label>
						</li>
						<li>
							' . form::textarea('content',self::postValue('content')) . '
						</li>';
						
						if(module::isActive('tag'))
						{
				$show .= '<li>
							<label for="tags">Tags: </label>
						</li>
			 <li>
							<input type="text" name="tags" value="' . self::postValue('tags') . '" />
						</li>';
						}
						 $show .= '
						<li>
							<label>Post in future? </label>
						</li>
						<li>
							<input type="checkbox" name="future" value="future" />
						</li>
						<li>
							<label for="date">Date:</label>
						</li>
						<li>
							' . form::date() . '
						</li>
						<li>
							<input type="submit" name="submit" value="Add Blog Entry" />
						</li>
					</ul>
				</fieldset>
			</form>';
			
		return $show;
	}
	
	public static function edit($errors, $blog)
	{
		$show = self::dispErrors($errors);
		$show .= '
			<form action="" method="post">
				<fieldset>
					<legend>Add New Blog Entry</legend>
					<label> Title: </label><input type="text" name="title" value="' . stripslashes($blog->title) .'" />
					<label> URL: </label><input type="text" name="url" value="' . $blog->url .'" />
					<label> Content: </label>
					' . form::textarea('content',stripslashes($blog->content)) . '
					<label>Post in future? </label> <input type="checkbox" name="future" value="future" />
					<input type="text" name="month" /> / <input type="text" name="day" /> /<input type="text" name="year" />  <input type="text" name="hour" />:<input type="text" name="min" />
					
					<input type="submit" name="submit" value="Add Blog Entry" />
				</fieldset>
			</form>';
			
		return $show;
	}

}
?>